package com.emergency.situation.controller;

import com.emergency.base.domain.Plan;
import com.emergency.base.domain.Scenar;
import com.emergency.situation.service.InitialService;
import com.emergency.common.entity.Result;
import com.emergency.common.entity.StatusCode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/initial")
@Api(value="初始态势展示类",description = "根据想定文件和计划方案展现事故的初始态势")
public class InitialController {

    @Autowired
    private InitialService initialService;

    @ApiOperation(value = "初始态势数据获取接口" ,notes="可以拆分成多个接口，分次获取数据，分流防止阻塞并发")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "scenarId", value = "想定文件id", required = true, paramType = "query", dataType = "String"),
            @ApiImplicitParam(name = "plan", value = "计划方案", required = true, paramType = "body", dataType = "Plan")
    })
    @RequestMapping(value = "state/data",method = RequestMethod.GET)
    public Result data(String scenarId, Plan plan){
        String data=initialService.getStateData(scenarId,plan);
        return new Result(true, StatusCode.OK,  "操作成功", "");
    }
}
